package com.ieheima.zixi;

import com.ieheima.demo.Student;

import java.io.*;

public class Demo02 {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        ObjectOutputStream oos = new ObjectOutputStream(
                new FileOutputStream("day13\\aaa\\b.txt"));
        Student stu = new Student("张三丰",231);
        oos.writeObject(stu);
        oos.close();
        ObjectInputStream ois = new ObjectInputStream(
               new FileInputStream("day13\\aaa\\b.txt"));
        Student o = (Student)ois.readObject();
        System.out.println(o);
        ois.close();
    }
}
